package com.zl.easybuy.util;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
//存放记录的页对象
@Getter
@Setter
public class Pages<T> {

    private Integer pageSize;//页容量
    private Integer pageIndex;//当前页码
    private long totalCount;//总记录数
    //private long totalPages;//总页数
    private List<T> record;//当前页记录
    private String url;//页码的url

    public Long getTotalPages(){
        return totalCount%pageSize==0 ? totalCount/pageSize : totalCount/pageSize+1;
    }
}
